package com.ajouroid.smartcoworker;

import java.util.ArrayList;

import android.graphics.PointF;

public class PathList {
	private int resWidth;
	private int resHeight;

	private int color;
	private float thick;
	private int style;
	private int eraser;
	private int type;
	
	private ArrayList<PointF> points;
	
	public PathList(int width, int height)
	{
		resWidth = width;
		resHeight = height;
		points = new ArrayList<PointF>();
	}
	
	public int getWidth()
	{
		return resWidth;
	}
	
	public int getHeight()
	{
		return resHeight;
	}
	
	public void setcolor(int _color)
	{
		color = _color;
	}
	
	public int getcolor()
	{
		return color;
	}
	
	public void setthick(float _thick)
	{
		thick = _thick;
	}
	
	public float getthick()
	{
		return thick;
	}
	
	public void setStyle(int _style)
	{
		style = _style;
	}
	
	public int getStyle()
	{
		return style;
	}
	public void setEraser(int _eraser)
	{
		eraser = _eraser;
	}
	
	public int getEraser()
	{
		return eraser;
	}
	
	public void setType(int _type)
	{
		type = _type;
	}
	
	public int getType()
	{
		return type;
	}
	
	
	

	public int size()
	{
		return points.size();
	}
	
	public void addExact(PointF p)
	{
		points.add(p);
	}
	
	public void add(PointF p)
	{
		PointF value = new PointF();
		
		value.x = p.x  / (float)resWidth;
		value.y = p.y / (float)resHeight;
		points.add(p);
	}
	
	public PointF get(int index)
	{
		return points.get(index);
	}
	public PointF getScaled(int index, int resW, int resH)
	{
		PointF value = points.get(index);
		PointF p = new PointF();
		p.x = resW * value.x;
		p.y = resH * value.y;
		
		//Log.d("PathList", String.format("%f, %f -> %d, %d", value.x, value.y, (int)p.x, (int)p.y));
		return p;
	}
}
